import unittest,requests


class MyTestCase(unittest.TestCase):
    host='http://10.59.9.18'
    #登录
    doctorId = None
    sessionId = None
    def test_1_login(self):
        url=MyTestCase.host+'/health/doctor/v1/login'
        json={"email":"2306398720@qq.com","pwd":"lZjdXyj15cOhn1a0yJKsW7o+fw/ogBDzn6CcyPSJUVIMmCPtCs+zuPwh7IZkXZiRhJvvjdIz9D2z1jkMOtD/36ddaLFMtQd9xIk0jAaDP1TH/lEHvvUPwot6asMGMGkH9EgBPT+4eaYC77BGQBPOASweQZE5KDF8BeN/c0sLfSw="}
        r=requests.post(url=url,data=json)
        print(r.json())
        MyTestCase.sessionId=r.json()['result']['sessionId']
        MyTestCase.doctorId=str(r.json()['result']['doctorId'])

    #上传形象照
    def test_2_uploadImagePic(self):
        url=MyTestCase.host+'/health/doctor/verify/v1/uploadImagePic'
        headers={"doctorId":MyTestCase.doctorId,"sessionId":MyTestCase.sessionId}
        json={"imagePic":""}
        r=requests.post(url=url,data=json,headers=headers)
        print(r.json())

    #查询系统形象照
    def test_3_findSystemImagePic(self):
        url=MyTestCase.host+'/health/doctor/v1/findSystemImagePic'
        r=requests.get(url=url)
        print(r.json())

    #选择系统提供形象照
    def test_4_findSystemImagePic(self):
        url=MyTestCase.host+'/health/doctor/verify/v1/chooseImagePic'
        headers = {"doctorId": MyTestCase.doctorId, "sessionId": MyTestCase.sessionId}
        json={"imagePic":"黑龙江"}
        r=requests.post(url=url,data=json,headers=headers)
        print(r.json())

    #绑定银行卡
    def test_5_bindDoctorBankCard(self):
        url=MyTestCase.host+'/health/doctor/verify/v1/bindDoctorBankCard'
        headers = {"doctorId": MyTestCase.doctorId, "sessionId": MyTestCase.sessionId}
        json={"bankCardNumber":"1","bankName":"1","bankCardType":1}
        r=requests.post(url=url,data=json,headers=headers)
        print(r.json())

    #查询医生银行卡信息
    def test_6_findDoctorBankCardById(self):
        url=MyTestCase.host+'/health/doctor/verify/v1/findDoctorBankCardById'
        headers = {"doctorId": MyTestCase.doctorId, "sessionId": MyTestCase.sessionId}
        r=requests.get(url=url,headers=headers)
        print(r.json())

    #查询医生身份证信息
    def test_7_findDoctorIdCardInfo(self):
        url=MyTestCase.host+'/health/doctor/verify/v1/findDoctorIdCardInfo'
        headers = {"doctorId": MyTestCase.doctorId, "sessionId": MyTestCase.sessionId}
        r=requests.get(url=url,headers=headers)
        print(r.json())

    #查询用户提现记录
    def test_8_findDoctorDrawRecordList(self):
        url=MyTestCase.host+'/health/doctor/verify/v1/findDoctorDrawRecordList'
        headers = {"doctorId": MyTestCase.doctorId, "sessionId": MyTestCase.sessionId}
        json={"page":1,"count":5}
        r=requests.get(url=url,params=json,headers=headers)
        print(r.json())

    #查询医生收支记录
    def test_9_findDoctorIncomeRecordList(self):
        url=MyTestCase.host+'/health/doctor/verify/v1/findDoctorIncomeRecordList'
        headers = {"doctorId": MyTestCase.doctorId, "sessionId": MyTestCase.sessionId}
        json={"page":1,"count":5}
        r=requests.get(url=url,params=json,headers=headers)
        print(r.json())

    #查询医生钱包
    def test_91_findDoctorWallet(self):
        url=MyTestCase.host+'/health/doctor/verify/v1/findDoctorWallet'
        headers = {"doctorId": MyTestCase.doctorId, "sessionId": MyTestCase.sessionId}
        json={"page":1,"count":5}
        r=requests.get(url=url,params=json,headers=headers)
        print(r.json())

    #提现
    def test_92_drawCash(self):
        url=MyTestCase.host+'/health/doctor/verify/v1/drawCash'
        headers = {"doctorId": MyTestCase.doctorId, "sessionId": MyTestCase.sessionId}
        json={"money":2090}
        r=requests.post(url=url,params=json,headers=headers)
        print(r.json())

    #添加医生极光推送token
    def test_93_addDoctorPushToken(self):
        url=MyTestCase.host+'/health/doctor/verify/v1/addDoctorPushToken'
        headers = {"doctorId": MyTestCase.doctorId, "sessionId": MyTestCase.sessionId}
        json={"token":'qweqwewqwe123'}
        r=requests.post(url=url,params=json,headers=headers)
        print(r.json())

    #查询医生收到的礼物列表
    def test_94_addDoctorPushToken(self):
        url=MyTestCase.host+'/health/doctor/verify/v1/findDoctorGiftList'
        headers = {"doctorId": MyTestCase.doctorId, "sessionId": MyTestCase.sessionId}
        json={"page":1,"count":5}
        r=requests.get(url=url,params=json,headers=headers)
        print(r.json())

    #查询系统通知消息
    def test_95_findDoctorSystemNoticeList(self):
        url=MyTestCase.host+'/health/doctor/verify/v1/findDoctorSystemNoticeList'
        headers = {"doctorId": MyTestCase.doctorId, "sessionId": MyTestCase.sessionId}
        json={"page":1,"count":5}
        r=requests.get(url=url,params=json,headers=headers)
        print(r.json())

    #查询问诊通知消息
    def test_96_findDoctorInquiryNoticeList(self):
        url=MyTestCase.host+'/health/doctor/verify/v1/findDoctorInquiryNoticeList'
        headers = {"doctorId": MyTestCase.doctorId, "sessionId": MyTestCase.sessionId}
        json={"page":1,"count":5}
        r=requests.get(url=url,params=json,headers=headers)
        print(r.json())

    #查询H币通知消息
    def test_97_findDoctorHealthyCurrencyNoticeList(self):
        url=MyTestCase.host+'/health/doctor/verify/v1/findDoctorHealthyCurrencyNoticeList'
        headers = {"doctorId": MyTestCase.doctorId, "sessionId": MyTestCase.sessionId}
        json={"page":1,"count":5}
        r=requests.get(url=url,params=json,headers=headers)
        print(r.json())

    #查询医生未读消息数
    def test_98_findDoctorNoticeReadNum(self):
        url=MyTestCase.host+'/health/doctor/verify/v1/findDoctorNoticeReadNum'
        headers = {"doctorId": MyTestCase.doctorId, "sessionId": MyTestCase.sessionId}
        json={"page":1,"count":5}
        r=requests.get(url=url,params=json,headers=headers)
        print(r.json())

    #修改消息状态为全部已读
    def test_99_modifyAllStatus(self):
        url=MyTestCase.host+'/health/doctor/verify/v1/modifyAllStatus'
        headers = {"doctorId": MyTestCase.doctorId, "sessionId": MyTestCase.sessionId}
        r=requests.put(url=url,headers=headers)
        print(r.json())

    #查询我的被采纳的建议
    def test_991_findMyAdoptedCommentList(self):
        url=MyTestCase.host+'/health/doctor/verify/v1/findMyAdoptedCommentList'
        headers = {"doctorId": MyTestCase.doctorId, "sessionId": MyTestCase.sessionId}
        json={"page":1,"count":5}
        r=requests.get(url=url,params=json,headers=headers)
        print(r.json())

    #查询医生职称列表
    def test_992_findMyAdoptedCommentList(self):
        url=MyTestCase.host+'/health/doctor/v1/findJobTitleList'
        r=requests.get(url=url)
        print(r.json())

    #病友圈列表展示
    def test_993_findSickCircleList(self):
        url=MyTestCase.host+'/health/doctor/sickCircle/v1/findSickCircleList'
        json = {"departmentId":1,"page": 1, "count": 5}
        r=requests.get(url=url,params=json)
        print(r.json())

    #查询病友圈详情
    def test_994_findSickCircleList(self):
        url=MyTestCase.host+'/health/doctor/sickCircle/v1/findSickCircleInfo'
        headers = {"doctorId": MyTestCase.doctorId, "sessionId": MyTestCase.sessionId}
        json = {"sickCircleId":1}
        r=requests.get(url=url,params=json,headers=headers)
        print(r.json())

    #根据关键词查询病友圈
    def test_995_searchSickCircle(self):
        url=MyTestCase.host+'/health/doctor/sickCircle/v1/searchSickCircle'
        json = {"keyWord":"头疼"}
        r=requests.get(url=url,params=json)
        print(r.json())

    #发表评论
    def test_996_publishComment(self):
        url=MyTestCase.host+'/health/doctor/sickCircle/verify/v1/publishComment'
        headers = {"doctorId": MyTestCase.doctorId, "sessionId": MyTestCase.sessionId}
        json = {"sickCircleId":1,"content":"哈哈"}
        r=requests.post(url=url,params=json,headers=headers)
        print(r.json())

    #查询医生的问诊记录列表
    def test_997_findInquiryRecordList(self):
        url=MyTestCase.host+'/health/doctor/inquiry/verify/v1/findInquiryRecordList'
        headers = {"doctorId": MyTestCase.doctorId, "sessionId": MyTestCase.sessionId}
        r=requests.get(url=url,headers=headers)
        print(r.json())

    #结束问诊
    def test_998_endInquiry(self):
        url=MyTestCase.host+'/health/doctor/inquiry/verify/v1/endInquiry'
        headers = {"doctorId": MyTestCase.doctorId, "sessionId": MyTestCase.sessionId}
        json={"recordId":1}
        r=requests.put(url=url,params=json,headers=headers)
        print(r.json())

    #查询问诊聊天记录
    def test_999_findInquiryDetailsList(self):
        url=MyTestCase.host+'/health/doctor/inquiry/verify/v1/findInquiryDetailsList'
        headers = {"doctorId": MyTestCase.doctorId, "sessionId": MyTestCase.sessionId}
        json={"recordId":1,"page": 1, "count": 5}
        r=requests.put(url=url,json=json,headers=headers)
        print(r.json())


    #查询医生历史问诊记录列表
    def test_9991_findHistoryInquiryRecord(self):
        url=MyTestCase.host+'/health/doctor/inquiry/verify/v1/findHistoryInquiryRecord'
        headers = {"doctorId": MyTestCase.doctorId, "sessionId": MyTestCase.sessionId}
        json={"page": 1, "count": 5}
        r=requests.get(url=url,params=json,headers=headers)
        print(r.json())





#执行
if __name__ == '__main__':
    unittest.main()
